<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>任务列表</title>
    <link rel="stylesheet" href="{{asset('css/font-awesome.min.css')}}">
    <link rel="stylesheet" href="{{asset('css/bootstrap.min.css')}}">
    <style>
        .isok {
            text-decoration: line-through;
            background: green;
            color: white;
        }

        .undid {
            background: red;
            color: white;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">Todolist</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="{{route('todolist.create')}}">添加任务</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div>
        <p>任务列表</p>
        <ol id="todolist">
            @foreach($todolist as $value)
                <li>
                    <span class="@if ($value->status == 1) isok @else undid @endif">{{ $value->desc }}</span>
                    @if($value->url != false)
                        <a target="_blank" href="{{ $value->url }}">
                            <i class="fa fa-commenting"></i>
                        </a>
                    @endif |
                    <a href="{{ route('todolist.edit', ['id' => $value->id]) }}"><i class="fa fa-edit"></i></a>
                    @if ($value->status == 0)
                        <a href="{{ route('todolist.ok', ['id' => $value->id]) }}"><i class="fa fa-check"></i></a>
                    @else
                        <a href="{{ route('todolist.undid', ['id' => $value->id]) }}"><i class="fa fa-close"></i></a>
                    @endif
                </li>
            @endforeach
        </ol>
    </div>

</div>

</body>
</html>